using Cysharp.Threading.Tasks;
using UnityEngine;
using UnityEngine.SceneManagement;
using Object = UnityEngine.Object;

namespace YPFramework
{
    public abstract class AssetsModule : MonoBehaviour
    {
        public string hostServerIP = "http://127.0.0.1";
        public string appVersion = "v1.0";

        public abstract void Initialized();

        /// <summary>
        /// 异步加载场景
        /// </summary>
        public abstract UniTask LoadSceneAsync(string location, LoadSceneMode sceneMode);

        /// <summary>
        /// 异步加载资源
        /// </summary>
        public abstract UniTask<T> LoadAssetAsync<T>(string location) where T : Object;

        /// <summary>
        /// 异步加载子资源
        /// </summary>
        public abstract UniTask<T> LoadSubAssetsAsync<T>(string path) where T : Object;

        /// <summary>
        /// 释放无用资源
        /// </summary>
        public abstract void UnloadUnusedAssets();
    }
}